﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="HMS.PL.Forms.SetRelation" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Set Relation</title>
    <script type="text/javascript" src="../Scripts/jquery-1.6.1.js"></script>
    <link type="text/css" rel="stylesheet" href="../themes/ui-lightness/jquery-ui-1.8.16.custom.css" />
    <link type="text/css" href="../themes/ui-lightness/jquery.ui.all.css" rel="stylesheet" />
    <link type="text/css" rel="stylesheet" href="../Style/!style1.css" />
    <%--jqgrid files--%>
    <link type="text/css" rel="stylesheet" href="../css/ui.jqgrid.css" />
    <link type="text/css" rel="stylesheet" href="../css/ui.multiselect.css" />
    <link type="text/css" rel="stylesheet" href="../themes/redmond/jquery-ui-1.8.1.custom.css" />
    <link type="text/css" rel="stylesheet" href="../Style/common.css" />
      <link type="text/css" rel="stylesheet" href="../css/demos.css" />
    <script src="../Scripts/jquery.layout-latest.js" type="text/javascript"></script>
    <script src="../Scripts/jqgrid/jquery.jqGrid.min.js" type="text/javascript"></script>
    <script src="../Scripts/jqgrid/grid.locale-en.js" type="text/javascript"></script>
    <script src="../Scripts/jqgrid/jqModal.js" type="text/javascript"></script>
    <script src="../Scripts/jqgrid/grid.base.js" type="text/javascript"></script>
    <script src="../Scripts/jqgrid/grid.common.js" type="text/javascript"></script>
    <script src="../Scripts/jqgrid/grid.formedit.js" type="text/javascript"></script>
    <script src="../Scripts/jqgrid/grid.inlinedit.js" type="text/javascript"></script>
    <script src="../Scripts/jqgrid/grid.jqueryui.js" type="text/javascript"></script>
    <script src="../Scripts/jqgrid/jquery.contextmenu.js" type="text/javascript"></script>
    <script src="../Scripts/jqgrid/jquery.tablednd.js" type="text/javascript"></script>
    <script src="../Scripts/jqgrid/jqDnR.js" type="text/javascript"></script>
    <script src="../Scripts/simpleresizabletables.js" type="text/javascript"></script>
    <script src="../Scripts/jqgrid/grid.filter.js" type="text/javascript"></script>
    <script type="text/javascript" src="../Scripts/jqgrid/jquery.searchFilter.js"></script>
    <%--jqgrid files--%>
    <script type="text/javascript" src="../Scripts/formsScript/welcome.js"></script>
    <script type="text/javascript" src="../Scripts/formsScript/setRelation.js"></script>
    <script type="text/javascript" src="../Scripts/formsScript/addRelation.js"></script>
    <script language="javascript" type="text/javascript">

        $(document).ready(function () {

            //debugger;

            var node_id = $("#hid_NodeId").val();
            var hier_id = $("#hid_HierarchyId").val();
            var table_name = $("#hid_TableName").val();
            var txtdate = $("#hid_txtdate").val();
            var dimname = $("#hid_dimname").val();
            var queryRel = $("#hid_query").val();
            //alert(queryRel);

            // var queryRel = window.opener.$("#div_" + dimname + "currule").html();

            // alert(queryRel);
            ////debugger;
            //var fl_rel = window.opener.$("#dtgrid" + dimname + "_rule");
            //alert( window.opener.$("#div_" + dimname + "currule")); 

            //alert(fl_rel);
            //var queryRel = fl_rel.jqFilter('toSQLString');

            //alert(queryRel);

            //get add relation grid data 
            //(those dimensions who are not linked with this node)
            getRelationData(node_id, dimname, table_name, hier_id, txtdate, queryRel);

        });     

    </script>
</head>
<body onbeforeunload="closeDlg();">
    <form id="form1" runat="server">
    <%--<label>
        <b>New</b></label>--%>
    <div style="margin-top: 25px;" align="center">
        <table id="dtgridNew" class="scroll" cellpadding="0" cellspacing="0">
        </table>
        <div id="pagerNew" class="scroll">
        </div>
    </div>
    <%-- <table>
            <tr>
                <td align="center">
                    <input type="button" value="Add Relation" onclick="javascript:addRelationRule();"
                        class="popupButton" />
                </td>
            </tr>
        </table>--%>
    <div align="center" style="margin-top: 10px;">
        <div align="right" style="width: 800px;">
            <input type="button" value="Add Relation" onclick="javascript:addRelationRule();"
                class="submit-button" />
        </div>
    </div>
    <div style="margin-top: 5px;" align="center">
        <%--<label>
            <b>Remove</b></label>--%>
        <table id="dtgridRem" class="scroll" cellpadding="0" cellspacing="0">
        </table>
        <div id="pagerRem" class="scroll">
        </div>
    </div>
    <%--  <table>
            <tr>
                <td align="center">
                    <input type="button" value="Remove Relation" onclick="javascript:remove_relRule();"
                        class="popupButton" />
                    <input type="button" value="Close" onclick="javascript:closeDlgCall();" class="popupButton" />
                </td>
            </tr>
        </table>--%>
    <div align="center" style="margin-top: 10px;">
        <div align="right" style="width: 800px;">
            <input type="button" value="Remove Relation" onclick="javascript:remove_relRule();"
                class="submit-button" style="height: 24px;" />
            <input type="button" value="Close" onclick="javascript:closeDlgCall();" class="submit-button"
                style="height: 24px;" />
        </div>
    </div>
    <asp:HiddenField ID="hid_NodeId" runat="server" />
    <%--<asp:HiddenField ID="hid_NodeTypeId" runat="server" />--%>
    <asp:HiddenField ID="hid_TableName" runat="server" />
    <asp:HiddenField ID="hid_HierarchyId" runat="server" />
    <asp:HiddenField ID="hid_txtdate" runat="server" />
    <asp:HiddenField ID="hid_dimname" runat="server" />
    <asp:HiddenField ID="hid_versid" runat="server" />
    <asp:HiddenField ID="hid_ret" runat="server" Value="false" />
    <asp:HiddenField ID="hid_query" runat="server" Value="false" />
    </form>
</body>
</html>
